from faker import Faker
from faker.providers import BaseProvider


# create new provider class. Note that the class name _must_ be ``Provider``.
class Provider(BaseProvider):

    def foo(self):
        return 'bar'


fake = Faker()
# then add new provider to faker instance
fake.add_provider(Provider)

# now you can use:
print(fake.foo())
# 'bar'
